﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using control.Biz;

namespace control.Dal
{
    class DalTrangThai
    {
        internal static List<control.Biz.BizTrangThai> GetAll()
        {
            var items = from item in DalCommon.TrangSucDB.TrangThais
                        select new BizTrangThai()
                        {
                            ID = item.ID,
                            TrangThai = item.TrangThai1,
                        };
            return items.ToList<BizTrangThai>();
        }


        internal static BizTrangThai GetByID(int TrangThai)
        {
            var items = from item in DalCommon.TrangSucDB.TrangThais
                        where item.ID==TrangThai
                        select new BizTrangThai()
                        {
                            ID = item.ID,
                            TrangThai = item.TrangThai1,
                        };
            return items.FirstOrDefault<BizTrangThai>();
        }
    }
}
